﻿@page "/ShowMenus"
@using Foo = BlazorOrdering.Core.BoMenu;
@using BlazorOrdering.Application;
@inject IBoMenuService menuService
<h3>查看菜谱</h3>

@if (meunlist == null)
{
    <p><em>Loading...</em></p>
}
else

{

    <Table TItem="Foo" Items="@meunlist" IsBordered="true" IsStriped="true">
        <TableColumns>
            <TableColumn @bind-Field="@context.Day"  FormatString="yyyy年MM月dd日 dddd" />
            <TableColumn @bind-Field="@context.Type" />
            <TableColumn @bind-Field="@context.Name" />
            <TableColumn @bind-Field="@context.Price" />
        </TableColumns>
    </Table>


}

@code {

    private List<BlazorOrdering.Core.BoMenu> meunlist;

    protected override async Task OnInitializedAsync()
    {
        meunlist = await menuService.GetMenus4ShowAsync(DateTime.Now.Date);
        await base.OnInitializedAsync();
    }

}
